package com._4paradigm.openmldb.java_sdk_test.cluster.disk;

import com._4paradigm.openmldb.java_sdk_test.common.OpenMLDBTest;
import com._4paradigm.openmldb.java_sdk_test.executor.ExecutorFactory;
import com._4paradigm.openmldb.test_common.model.SQLCase;
import com._4paradigm.openmldb.test_common.model.SQLCaseType;
import com._4paradigm.openmldb.test_common.provider.Yaml;
import io.qameta.allure.Feature;
import io.qameta.allure.Story;
import lombok.extern.slf4j.Slf4j;
import org.testng.annotations.Test;

@Slf4j
@Feature("Disk-Table")
public class DiskTableTest extends OpenMLDBTest {

    @Test(dataProvider = "getCase",enabled = false)
    @Yaml(filePaths = "function/disk_table/disk_table.yaml")
    @Story("batch")
    public void testDiskTable(SQLCase testCase){
        ExecutorFactory.build(executor,testCase, SQLCaseType.kBatch).run();
    }

    @Test(dataProvider = "getCase")
    @Yaml(filePaths = "function/disk_table/disk_table.yaml")
    @Story("request")
    public void testDiskTableRequestMode(SQLCase testCase){
        ExecutorFactory.build(executor,testCase, SQLCaseType.kRequest).run();
    }

    @Story("requestWithSp")
    @Test(dataProvider = "getCase")
    @Yaml(filePaths = "function/disk_table/disk_table.yaml")
    public void testDiskTableRequestModeWithSp(SQLCase testCase) throws Exception {
        ExecutorFactory.build(executor, testCase, SQLCaseType.kRequestWithSp).run();
    }
    @Story("requestWithSpAysn")
    @Test(dataProvider = "getCase")
    @Yaml(filePaths = "function/disk_table/disk_table.yaml")
    public void testDiskTableRequestModeWithSpAysn(SQLCase testCase) throws Exception {
        ExecutorFactory.build(executor, testCase, SQLCaseType.kRequestWithSpAsync).run();
    }

    @Test(dataProvider = "getCase",enabled = false)
    @Yaml(filePaths = "function/disk_table/disk_table.yaml")
    @Story("CLI")
    public void testDiskTable3(SQLCase testCase){
        ExecutorFactory.build(testCase, SQLCaseType.kClusterCLI).run();
    }
}
